package com.iqik.service;

import org.apache.dubbo.config.annotation.Service;

import java.util.Random;

@Service
public class DelayServiceImpl implements DelayService {
    @Override
    public String methodA() {
        randomDelay();
        return "This is method A";
    }

    @Override
    public String methodB() {
        randomDelay();
        return "This is method B";
    }

    @Override
    public String methodC() {
        randomDelay();
        return "This is method C";
    }

    private void randomDelay() {
        try {
            Thread.sleep(new Random().nextInt(50));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

}
